website=jQuery.noConflict();

website().ready(function() {
					
                    website("#website-entry-node-form").validate({
													  


// Title Validation
  rules: {
						'field_department[und]': { 
							required: true,
							maxlength: 255,
							chkbadchar:true,
							valuenotequals: '_none',
						},
						'field_web_org[und]': { 
							required: true,
							maxlength: 255,
							chkbadchar:true,
							valuenotequals: '_none',
						},
						'field_web_dist[und][]':{
							multi_dist_select: true,
							
							},
						'title': { 
							required: true,
							minlength: 5,
							maxlength: 255,
							chkbadchar:true,
							splchar:true,
						},
						'field_web_categorys[und]':{
							required:true,
							valuenotequals:'_none',
							
							},
        
    					'field_web_otherscategory[und][0][value]':{
							required: true,
							minlength: 5,
							maxlength: 255,
							chkbadchar:true,							
							},
						
						
						
						
						'field_web_url[und][0][value]':{
							required:true,
							url: true,
							chkbadchar:true,						},
						
						'field_web_keyword[und][0][value]':{
							minlength: 5,
							maxlength: 255,
							chkbadchar:true,
							splchar:true,							
						},
						
					
					},
            
messages: {
						'field_department[und]':{
							required: 'Please Select Concerned Department',
							maxlength:  'Maximum 255 character only allowed',
							chkbadchar: 'insert, select, update, delete, drop, alter, change, modify not allowed.',
							valuenotequals: 'Please Select Concerned Department',
							},
							'field_web_org[und]':{
							required: 'Please Select Organization',
							maxlength:  'Maximum 255 character only allowed',
							chkbadchar: 'insert, select, update, delete, drop, alter, change, modify not allowed.',	
							valuenotequals: 'Please Select Organisation Name',
							},
							'field_web_dist[und][]':{
							required: 'Please Select Districts',
							maxlength:  'Maximum 255 character only allowed',
							chkbadchar:'insert, select, update, delete, drop, alter, change, modify not allowed.',	
							multi_dist_select: 'Please Select either All or Particular Districts',
							},
							'title': { 
							required:  'Please enter Title',
							minlength: 'Minimum 5 characters should be entered',
							maxlength: 'Maximum 255 character only allowed',
							chkbadchar:'insert, select, update, delete, drop, alter, change, modify not allowed.',
							splchar:'Special Characters are not allowed',
							},
							'field_web_categorys[und]': {
							required: 'Please Select Document Category',
							maxlength:  'Maximum 255 character only allowed',
							chkbadchar: 'insert, select, update, delete, drop, alter, change, modify not allowed.',	
							valuenotequals: 'Please Select Document Category',
							},
													  
							'field_web_otherscategory[und][0][value]':{
							required:  'Field Value is Required',
							minlength: 'Minimum 5 characters should be entered',
							maxlength:  'Maximum 255 character only allowed',
							chkbadchar:'insert, select, update, delete, drop, alter, change, modify not allowed.',
							splchar:'Special Characters are not allowed',						
							},
							
							
							
							'field_web_url[und][0][value]':{
							required: "Please Enter URL",
							url: 'Not Valid URL',
							chkbadchar:'insert, select, update, delete, drop, alter, change, modify not allowed.',

							},
							
							'field_web_keyword[und][0][value]':{
							minlength: 'Minimum 5 characters should be entered',
							maxlength:  'Maximum 255 character only allowed',
							chkbadchar:'insert, select, update, delete, drop, alter, change, modify not allowed.',
							splchar:'Special Characters are not allowed',					
							},
							
	
				}, 
					//errorLabelContainer: "#errormsg_container",
					 //focusInvalid: false,
   					invalidHandler: function(form, validator) {
       
       					 if (!validator.numberOfInvalids())
								return;
						else{
							
							  //website("#documents-node-form").create_errormsg_container('errormsg_container','documents-node-form');
						}
							
							website('html, body').animate({
								scrollTop: website(validator.errorList[0].element).offset().top - 100
							}, 1000);
							
						},
				

   
	});




            
});


